<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件嵌套</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
    </div>
</body>
<script type="text/javascript">
    Vue.config.productionTip = false //以阻止 vue 在启动时生成生产提示。
    const student = Vue.extend({
        template:`
            <div>
                <h1>{{name}}</h1>
            </div>
        `,
        data(){
            return {
                name:'小米同学'
            }
        }
    })
    const school = Vue.extend({
        template:`
            <div>
                <h1>{{name}}</h1>
                <student></student>
            </div>
        `,
        data(){
            return {
                name:'新新小学'
            }
        },
        components:{
            student
        }
    })
    const hello = Vue.extend({
        template:`
            <div>
                <h1> {{hello}} </h1>
            </div>
        `,
        data(){
            return {
                hello:'您好'
            }
        },
    })
   
    const app = Vue.extend({
        template:`
            <div>
                <school></school>
                <hello></hello>
            </div>
        `,
        components:{
            school,
            hello
        }
    })
    const vm = new Vue({
        el:'#root', 
        template:`<app></app>`,
        components:{
            app
        }
    })
    //components components components components
</script>
</html>